import { defHttp } from '@/apis/http'
import type { CommonAPI } from '@/apis/schema/all'

/**
 * @description: 版本
 */

/** 获取版本说明 */
export const getAdminApiNodeVersionImprintApi: CommonAPI<
  '/admin/api/version/imprint',
  'get'
> = (params) => defHttp.get(`/admin/api/version/imprint`, { params })

/** 获取版本详情 */
export const getAdminApiNodeVersionInfoDetailApi: CommonAPI<
  '/admin/api/version/info',
  'get'
> = (params) => defHttp.get(`/admin/api/version/info`, { params })

/** 获取版本列表 */
export const getAdminApiNodeVersionQueryListApi: CommonAPI<
  '/admin/api/version/query',
  'get'
> = (params) => defHttp.get(`/admin/api/version/query`, { params })

/** 获取上传解析结果 */
export const getAdminApiNodeVersionUploadParseApi: CommonAPI<
  '/admin/api/version/upload-parse',
  'get'
> = (params) => defHttp.get(`/admin/api/version/upload-parse`, { params })

/** 获取版本 */
export const getAdminApiSystemVersionApi: CommonAPI<
  '/admin/api/system/version',
  'get'
> = (params) => defHttp.get(`/admin/api/system/version`, { params })

/** 删除版本(当前版本没)*/
export const deleteApiNodeVersionApi: CommonAPI<
  '/admin/api/version',
  'delete'
> = (data) =>
  defHttp.delete(
    `/admin/api/version/${data.id}`,
    { data },
    {
      isTransformResponse: false
    }
  )
